package cn.mifengkong.appcommon.webview.uicomponent;

import android.content.Context;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import cn.mifengkong.appcommon.R;

/**
 * Created by jack on 2017/11/16
 */

public class NetWorkErrorUIComponent extends LinearLayout {
    public NetWorkErrorUIComponent(Context context) {
        super(context);
    }

    public NetWorkErrorUIComponent(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public NetWorkErrorUIComponent(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private TextView tvRefresh;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        tvRefresh = (TextView) findViewById(R.id.lnn_tv_refresh);
    }

    public void setTvRefreshBackground(@DrawableRes int resId, @ColorInt int textColor) {
        tvRefresh.setBackgroundResource(resId);
        tvRefresh.setTextColor(textColor);
    }

    public void setRefreshOnClickListener(OnClickListener clickListener) {
        tvRefresh.setOnClickListener(clickListener);
    }
}
